package com.lh.java.basic.threadlocal;


public class Thread8 {

	/**
	 * 功能描述  
	 * @Author: lh  2013-3-29 上午11:45:16
	 */
	public static void main(String[] args) {
		  Thread t1 = new Thread(  new Runnable() {  public void run() {  synchronized (Object4.class) {
			  for(int i=0;i<=5;i++){
				  try {
					Thread.sleep(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				  System.out.println(Thread.currentThread().getName()+i);
			  }
			
		};  }  }, "t1"  ); 
		  Thread t2 = new Thread(  new Runnable() {  public void run() {  synchronized (Object4.class) {
			  for(int i=100;i<=105;i++){
				  try {
					Thread.sleep(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				  System.out.println(Thread.currentThread().getName()+i);
			  }
			};  }  }, "t2"  ); 
		t1.start();
		t2.start();
		

	}

}
class Object4{
	public static int a =5;
	
}